package com.to_door_recycle.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 用户下单回收物品（订单项)
 * @TableName order_item
 */
@TableName(value ="order_item")
@Data
public class OrderItem implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 回收物品的id
     */
    @TableField(value = "recycle_product_id")
    private Integer recycleProductId;

    /**
     * 物品图片
     */
    @TableField(value = "image_urls")
    private String imageUrls;

    /**
     * 订单编号
     */
    @TableField(value = "order_id")
    private String orderId;

    /**
     * 是否可用
     */
    @TableField(value = "normal")
    private Integer normal;

    /**
     * 用户选择规格值
     */
    @TableField(value = "select_specification")
    private String selectSpecification;

    /**
     * 规格单位
     */
    @TableField(value = "specification_unit")
    private String specificationUnit;

    /**
     * 计划回收物品
     */
    @TableField(value = "plan_recycle_product")
    private String planRecycleProduct;

    /**
     * 实际回收物品
     */
    @TableField(value = "actual_recycle_product")
    private String actualRecycleProduct;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrderItem other = (OrderItem) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getRecycleProductId() == null ? other.getRecycleProductId() == null : this.getRecycleProductId().equals(other.getRecycleProductId()))
            && (this.getImageUrls() == null ? other.getImageUrls() == null : this.getImageUrls().equals(other.getImageUrls()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getNormal() == null ? other.getNormal() == null : this.getNormal().equals(other.getNormal()))
            && (this.getSelectSpecification() == null ? other.getSelectSpecification() == null : this.getSelectSpecification().equals(other.getSelectSpecification()))
            && (this.getSpecificationUnit() == null ? other.getSpecificationUnit() == null : this.getSpecificationUnit().equals(other.getSpecificationUnit()))
            && (this.getPlanRecycleProduct() == null ? other.getPlanRecycleProduct() == null : this.getPlanRecycleProduct().equals(other.getPlanRecycleProduct()))
            && (this.getActualRecycleProduct() == null ? other.getActualRecycleProduct() == null : this.getActualRecycleProduct().equals(other.getActualRecycleProduct()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getRecycleProductId() == null) ? 0 : getRecycleProductId().hashCode());
        result = prime * result + ((getImageUrls() == null) ? 0 : getImageUrls().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getNormal() == null) ? 0 : getNormal().hashCode());
        result = prime * result + ((getSelectSpecification() == null) ? 0 : getSelectSpecification().hashCode());
        result = prime * result + ((getSpecificationUnit() == null) ? 0 : getSpecificationUnit().hashCode());
        result = prime * result + ((getPlanRecycleProduct() == null) ? 0 : getPlanRecycleProduct().hashCode());
        result = prime * result + ((getActualRecycleProduct() == null) ? 0 : getActualRecycleProduct().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", recycleProductId=").append(recycleProductId);
        sb.append(", imageUrls=").append(imageUrls);
        sb.append(", orderId=").append(orderId);
        sb.append(", normal=").append(normal);
        sb.append(", selectSpecification=").append(selectSpecification);
        sb.append(", specificationUnit=").append(specificationUnit);
        sb.append(", planRecycleProduct=").append(planRecycleProduct);
        sb.append(", actualRecycleProduct=").append(actualRecycleProduct);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}